package com.neusoft.neuiotms.dcom.converter;

import org.springframework.stereotype.Component;

import com.neusoft.bizcore.web.dto.AbstractConverter;
import com.neusoft.neuiotms.dcom.dto.MonthUnfinishedItemDescDTO;
import com.neusoft.neuiotms.dcom.model.MonthUnfinishedItemDesc;

@Component
public class MonthUnfinishedItemDescConverter
        extends AbstractConverter<MonthUnfinishedItemDesc, MonthUnfinishedItemDescDTO> {

    @Override
    public MonthUnfinishedItemDesc toModel(final MonthUnfinishedItemDescDTO dto) {

        final MonthUnfinishedItemDesc model = new MonthUnfinishedItemDesc();

        model.setName(dto.getName());
        model.setOperationName(dto.getOperationName());
        model.setOperationCode(dto.getOperationCode());
        model.setReason(dto.getReason());
        model.setSolution(dto.getSolution());

        return model;
    }

    @Override
    public MonthUnfinishedItemDescDTO toDTO(final MonthUnfinishedItemDesc model, final boolean forListView) {

        final MonthUnfinishedItemDescDTO dto = new MonthUnfinishedItemDescDTO();

        dto.setId(model.getId());
        dto.setName(model.getName());
        dto.setOperationName(model.getOperationName());
        dto.setOperationCode(model.getOperationCode());
        dto.setReason(model.getReason());
        dto.setSolution(model.getSolution());

        return dto;
    }

}
